<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>

<html>
    <head>

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
	
	
	<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<style type="text/css">
		.img{
			height: 40;
		}
		.font{
			color:white;
			font-size: 17px;
		}
		.font1{
			color:white;
			font-size: 30px;
		}
		.round {
		   padding:10px; width:300px; height:50px;
		   border: 0px solid #dedede;
		   -moz-border-radius: 5px;      /* Gecko browsers */
		   -webkit-border-radius: 5px;   /* Webkit browsers */
		   border-radius:5px;            /* W3C syntax */
}
	</style>
	<script type="text/javascript">
		function next(){
			var address=document.getElementById("address").value;
			window.location.href="details.jsp?address="+address;
		}
		function is_return(){
  			window.location.href="index.jsp";
  		}
		function Upfinname(id,yaddress){
			var yid=id;
			var address =yaddress;
			window.location.href = "${path}/bassm/Visitor/selectFinPhoneorUserNameLou?yid="+yid+"&yaddress="+address;
		}
	</script>
		<script type="text/javascript">
	function disable(id){
		var id2=id;
		var num  = document.getElementById("option").value;
		var paer={id:id2,num:num};
		$.ajax({
			url:"${path}/bassm/Visitor/addUserInformationFist",
			data:paer,
			type:"post",
			async:false,
			success:function(date){
				if(date.msg==1){		
					var xq=date.detailed;
					window.location.href = "${path}/bassm/Visitor/visitorsuser3?Celladdress="+xq;
					alert("成功");
				}else{
					alert("错误")
				}
			},
			error:function(){
				alert("异常错误，请联系供应商");
			}
		});
	}
	</script>
		<script type="text/javascript">
		function seleconetow(name){
			
			var nameone = name;
			window.location.href = "${path}/bassm/Visitor/selectponediao?yaddress="+nameone;
		}
	
		function seleconetowretun(name){
			
			var urluser = name;
			window.location.href = "${path}/bassm/index1.jsp";
		}
		function baimingdan(name){
			debugger;
			var urluser = name;
			var indexnamer ="1";
			window.location.href = "${path}/bassm/Visitor/visitorsuser4?Celladdress="+urluser+"&index="+indexnamer;
		}
		function heimingdan(name){
			debugger;
			var urluser = name;
			var indexnamer ="0";
			window.location.href = "${path}/bassm/Visitor/visitorsuser4?Celladdress="+urluser+"&index="+indexnamer;
		}
		
		
		function finname(yid){
		var sfzid2=yid;
		var paer={id:sfzid2};
		debugger;
		$.ajax({
			url:"${path}/bassm/Visitor/DeleUserInformationFist",
			data:paer,
			type:"get",
			async:false,
			success:function(date){
				if(date.msg==1){		
					var xq=date.detailed;
					window.location.href = "${path}/bassm/Visitor/visitorsuser3?Celladdress="+xq;
					alert("成功");
				}else{
					alert("错误");
				}
			},
			error:function(){
				alert("异常错误，请联系供应商");
			}
		});
	}
	</script>
	
  </head>
  
  <body>
  
  	<div class="container-fluid">
      <div class="row">
        
        	<table border="0" align="center" height="100%">
        	
    	<tr height="40px" bgcolor="#333B46">	
    		<td align="left" width="300px;"><font class="font1"><span >&nbsp;&nbsp;<img src="img/2006707973.jpg" height="20px;" onclick="seleconetowretun('${address}')"/></span></font></td>
    		<td  align="center" width="600px;"><font class="font">访客管理系统</font>
    		<td align="right"  width="400px;"><font class="font1">&nbsp;&nbsp;
    		<img src="img/651682395.jpg" height="20px;" align="top" onclick="seleconetow('${address}')"/>&nbsp;</font>
    		
    		</td>
    		</td>	
    	</tr>
    	
    	<tr height="60px" bgcolor="#ffffff">
    		<td width="200px" height="80px" colspan="3">
    		<img  src="img/1587345515.jpg" height="100px" width="210px"  align="left">
    		<img  src="img/shehe1.jpg" height="50px" align="right" onclick="baimingdan('${address}')">
    		<img  src="img/shenhe2.jpg" height="50px" align="right" onclick="heimingdan('${address}')">
			</td>
    	</tr>
    	<c:forEach var="v" items="${products}">
    	<tr bgcolor="#F2F3F4">
    		<td align="center"><img alt="" src="${v.yimageurl}" width="80" height="80" style=" border-radius: 45px;" ></td>
    		<td align="left" style="font-size: 15px">
    			姓名:${v.yname}   <img alt="" src="img/1049628162.jpg"  onclick="Upfinname(${v.yid},'${v.yaddress}')"; width="16" height="15"  align="top"><br>
    			
    			单元楼:
    			<%-- <c:if test="${fn:contains(v.yunitdoor==0) }">
	    			全部
	    			</c:if> --%>
	    		<c:if test="${(v.yunitdoor =='0') }">
					全部
				</c:if>
	    		<c:if test="${(v.yunitdoor != '0') }">
					${v.yunitdoor}
				</c:if>
    			
    			    <br>
    			电话:${v.yphone} <br> 
					<c:if test="${fn:contains(v.yindate,'1') }">
	    				<c:if test="${fn:contains(v.visitorstype,'1') }">
	    				30天
	    				</c:if>
	    				<c:if test="${fn:contains(v.visitorstype,'2') }">
	    				1天
	    				</c:if>
	    			</c:if>
	    			<c:if test="${fn:contains(v.yindate,'0') }">
	    			<select id ="option" name="option">
	    			<option value="1">30天</option>
	    			<option value="2">1天</option>
	    			</select>
	    			</c:if>
	    			
	    			
	    			
	    			    			
				
    		</td>
    		<td align="center">
    				<c:if test="${fn:contains(v.yindate,'1') }">
	    			<button style="width: 80px; height:40px; background-color:#fe6262; color: white; font-size: 12px;" onclick="finname(${v.yid})"id="finname" class="round">禁止</button>
	    			</c:if>
	    			<c:if test="${fn:contains(v.yindate,'0') }">
					 <button style="width: 80px; height:40px; background-color:#27a2f0; color: white; font-size: 12px;" onclick="disable(${v.yid})" id="addbmd"  class="round">允许</button>
	    			</c:if>
    		</td>
    	</tr>
    	</c:forEach>
    	<tr height="20px" bgcolor="#F2F3F4">
    		<td colspan="3" align="center">
    		<c:choose> 
    						<c:when test="${page.pageNow - 1 > 0}"> 
    						 <a href="${path}/bassm/Visitor/visitorsuser3?pageNow=${page.pageNow - 1}&Celladdress=${address}"> 
    						<img alt="" src="img/186846180.jpg" height="17px"></a>
    						</c:when>
    						<c:when test="${page.pageNow - 1 <= 0}">
    						<a href="${path}/bassm/Visitor/visitorsuser3?pageNow=1&Celladdress=${address}">
    						<img alt="" src="img/186846180.jpg" height="17px"></a>
    						</c:when>
    		</c:choose> 
    						&nbsp;&nbsp;
    		<c:choose> 
    						<c:when test="${page.totalPageCount==0}"> 
    						<a href="${path}/bassm/Visitor/visitorsuser3?pageNow=${page.pageNow}&Celladdress=${address}">
    						<img alt="" src="img/1868461829.jpg" height="17px"></a>
    						</c:when>
    						<c:when test="${page.pageNow + 1 < page.totalPageCount}"> 
    						<a href="${path}/bassm/Visitor/visitorsuser3?pageNow=${page.pageNow + 1}&Celladdress=${address}">
    						<img alt="" src="img/1868461829.jpg" height="17px"></a>
    						</c:when>
    						<c:when test="${page.pageNow + 1 >= page.totalPageCount}"> 
    						 <a href="${path}/bassm/Visitor/visitorsuser3?pageNow=${page.totalPageCount}&Celladdress=${address}">
    						 <img alt="" src="img/1868461829.jpg" height="17px"></a>
    						</c:when>
    		</c:choose> 				
    		</td>
    	</tr> 
    </table>
      </div>
    </div>
  </body>
</html>
